'use strict';var _Za,_Ja,_gg;
{let v=function(){_v("customEntities.*",(a,b)=>void 0+(_hf._Ot[b[1]]=_Kg(a,...b)));_v("customEntities.menuStyle",(a,b)=>void 0+_hf._Td(_Kg(a,...b)));_Ao("customEntities.binSwtch.*",(a,b)=>_Ph&&e(!0));_Ao("customEntities.tse","trigActList.*.actions",(a,b)=>void 0+_hf._re(a));_Ao("customEntities.menuSpec","previewMakerParams","trigActList.*.actions",(a,b)=>void 0+_hf._sy(a));_Ao("trigActList.*.triggers","mouseGest.triggers",(a,b)=>void 0+_hf._0s(a));_Ao("trigActList.*.disabled","trigActList.*.",(a,
b)=>void 0+_hf._mg(a)+_Xd(a));_v("mouseGest.params",(a,b)=>void 0+_hf._8w(_Kg(a,...b)));_v("mouseGest.display",(a,b)=>void 0+_hf._3k(_Kg(a,...b)));_v("toolbarBtns",(a,b)=>_Ph&&_ni(_Kg(a,...b)));_v("sections",(a,b)=>_Ph&&$("body").toggleClass("hasSectns",a[b[0]].length));_v("advOpts.*",(a,b)=>{"ignInjInp"==b[1]?_hf._Hi(a[b[0]]):_hf._0s(a)});_Ky.storage.onChanged.addListener((a,b)=>{"local"==b&&(b=_Kg(a,"LOCAL","oldValue","switchStates"),(a=_Kg(a,"LOCAL","newValue","switchStates"))&&JSON.stringify(a)!=
JSON.stringify(b)&&e())})};var _va={actions:{templ:"trigActsPanel",func:_ly},options:{templ:"optionsPanel",func:_rw},help:{templ:"helpPanel"}};let h,e=_Ow(300,function(a=!1){let b=[..._Ws("binSwtch",!0)].map(k=>{let l=_Uk(k)[1];return`<swt entId=${l}><name spellcheck=false>${_er(k).name}</name><st val=${_hf._gy[l]|0} title="Click to toggle"></st></swt>`}).join("");var c=$("tabs > switches");let d=c.hasClass("visible");c=c.toggleClass("visible",!!b).find("> cont").html(b);a&&(_hf._Oe(),h||!b||d||(h=
!0,_Jh("<c>Rename your switch here.</c>",c,"rbt","infoBubble small","","opacity")))}),w=function(){$("body > tabs").on("mousedown","tab:not([active])",function(){_Uj(this)();this.noNameEdit=!0}).on("mousedown","sectns > tab",function(a){let b;$(document.body).on("mouseenter.sectnTabDrag","sectns > tab:not([active])",c=>{let d=this.getBoundingClientRect();_Lp(this,c.clientY<d.top?-1:1,200);b=!0}).on("mouseup.sectnTabDrag",()=>{$(document.body).off(".sectnTabDrag");b&&$(this).triggerEvt("change",!0)})}).on("click",
"sectns tab[active]",function(){this.noNameEdit||_na($("name",this)[0]);delete this.noNameEdit}).on("focusout","name",function(){this.innerText.length||(this.innerText="\u2639");this.innerText=this.innerText.replace(/[\r\n]+/g," ").slice(0,50);$(this).triggerEvt("change",!0);this.contentEditable=!1;getSelection().removeAllRanges();this.scrollLeft=0}).on("change","> sectns",function(){_pd(_x(this),_pu(this))});$("body > tabs > switches").on("mousedown","st",function(){_hf._es(+$(this).parent().attr("entId"),
!+$(this).attr("val"))}).on("click","name",function(){_na(this)}).on("keydown","name",function(a){13==a.keyCode&&this.blur()}).on("change","name",function(){this.innerText=_oi(this.innerText);let a="binSwtch:"+$(this).parent().attr("entId");_we([a,"name"],this.innerText,0);$(`[value='${a}'] > l`).text(this.innerText)})};var _le="actions";let p=_Et(function*(){v();_oj();_ja();w();window.onbeforeunload=function(){$(document.body).triggerEvt("mousedown")};let a="AutoControl configuration";"function"==
typeof customizeVariant&&([a,_le]=yield customizeVariant());document.title=a;(yield _9s(_hf._2u.wait(),_Pi(500)))||($("html").css("display","block"),_pg(),yield _9s(_hf._2u.wait(),_Pi(3E3)),_pg(!1));_hf._Rd?($(document.body).is(".msgWin")||m(3,500)(b=>{b||(_Sa(_ne("natHostNotFound"),{title:"Native Component not working",icon:"error",width:"initial",nearMouse:!1})(c=>{"reload"==c?_hf._Ww(2,!0):"reinstall"==c&&f()}),_6p("NH-noConnex"))}),_Do&&!(yield _Do.afterLoad())||n()):($("html").addClass("visible"),
x())});_uf(document.fonts.load("25px logoFont"),document.fonts.load("12px symbols"),document.fonts.load("15px gestureDirs"),a=>_oh("AutoCtrl/file91.js",a),a=>_kd("AutoCtrl/file22.css",a),_Yj.wait())(p,p);var _zj=_wj(function*(){let a=_Pr(yield c=>_Ky.storage.local.get(null,c)),b=$("body > tabs > perms > cont");b[0]&&b.html(yield _Fj(a.filter(c=>"bg"!=c)));return a}),_ug=_wj(function*(a){let b=yield c=>_tl({toolbarBtns:{},sections:[]},c);_ni(b.toolbarBtns);$("body > tabs > sectns").html(b.sections.map(_3g).join(""));
$("body").toggleClass("hasSectns",b.sections.length);e();(a=$(`body > tabs [pnlId='${a}']`)[0])&&(yield _Uj(a));return yield _zj()});let n=_Et(function*(a=!1){var b=_st(location);b?(document.title="Script Editor - AutoControl",yield _ty("file38.html",!0),$("html").css("display","block"),yield _Tk(b,!0),$("html").addClass("visible")):(b=(location.hash||"").slice(1)||(_Do?_8y(_Kg((yield _qf("trigActList"))[Symbol.iterator]().next().value,1,"sctnId")):_le),b=yield _ug(b),$("html").addClass("visible"),
yield _Pi(600),yield _9h(b,"permMsgs/missing",!0),yield _Pi(1E3*(a?180:5)),a=$("<contribBtn>Support<br>the project</contribBtn>").appendTo("body > tabs").click(()=>{let c=_2("Support the Project",_ne("contribPanel"),"",!1,!0);$("[contribPanel]",c)[0].scrollTop=0}),yield c=>_Bd(c),a.addClass("onview"),yield _Pi(1700),q(),setInterval(q,6E4))}),q=()=>{let a=$("contribBtn").addClass("animate");setTimeout(()=>a.removeClass("animate"),2E3)},y=0,r=0,f=_Et(function*(a=0){if(!(3E3>Date.now()-r)&&(r=Date.now(),
_6p("NH-dwnld",{method:a}),5.1<=_Hf&&11>_Hf&&/^win/i.test(navigator.platform)||(yield _Yo("",_ne("unsupportedOS"),{yes:"Try installing anyway",no:"Cancel",icon:"info",width:"initial"})))){switch(a){case 0:_4s(_Q,yield _Pu(_pw,"blob"))}$("runInstPane")[0]||_ne("runInstPane").appendTo("body");3==++y&&setTimeout(()=>_yt(_ne("installTrouble"),{width:"initial"}),3E3);yield _Pi(4E3);$("runInstPane").addClass("visible");t();yield _Pi(3E3);$("installPane ques[help]:not(.open)").each((b,c)=>u(c));yield _Pi(400);
$("install").each(function(){this.scrollIntoView({behavior:"smooth"})});yield _Pi(3E4);$("runInstPane").remove()}}),m=_wj(function*(a,b){for(let c=0;c<a;++c){let d=yield _hf._fw(_Zf,"",b);if(void 0===d)yield _Pi(b);else if("pong"==d)return!0}return!1}),g,t=function(){g||(g=!0,m(Infinity,1E3)(()=>{g=!1;z()}))},u=a=>{let b=function(){$("+ answ",this).css("width",this.offsetWidth).slideToggle(300,function(){});$(this).toggleClass("open")};$(a).siblings("ques.open").each(b);b.call(a)},x=()=>{let a="",
b=()=>_yt(_ne("natHostInit"),{width:"initial",nearMouse:!1});$("head title").addClass("notranslate").append(" - Native Component");$(document.body).addClass("installPane");_ne("installPane").on("click","install",()=>f(0)).on("click","a[install]",()=>f(3)).on("click","installPane",()=>$("runInstPane").remove()).on("mousedown","faq > ques",function(){u(this)}).on("keypress",c=>{a=(a+String.fromCharCode(c.which)).slice(-10);"NH-INSTALL"==a&&(_6p("NH-install"),$("runInstPane").remove(),b())}).appendTo("body");
_hf._ar&&setTimeout(()=>{b();t()},600)},z=()=>{$("installWrap").off("keypress");_5p("dialog");$("installPane, runInstPane").remove();$("installWrap")[0]&&(n(!0),setTimeout(()=>{$("installWrap").fadeOut(1E3,function(){this.remove();$("body").removeClass("installPane")})},350))}};
